//
//  StateContext.m
//  LearnObjectiveC
//
//  Created by client on 2017/9/8.
//  Copyright © 2017年 吴可高. All rights reserved.
//

#import "StateContext.h"

@implementation StateContext
@synthesize state;

-(void)setState:(State *)newState
{
    state = newState;
}

-(State *)state
{
    return state;
}

-(void)method
{
    if ([state.value isEqualToString:@"state1"]) {
        [state method1];
    }
    else if ([state.value isEqualToString:@"state2"])
    {
        [state method2];
    }
}

@end
